package com.ruoyi.depot.mapper;

import java.util.List;
import com.ruoyi.depot.domain.OutboundOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 出库单Mapper接口
 * 
 * @author lxy
 * @date 2025-06-10
 */
@Mapper
public interface OutboundOrderMapper 
{
    /**
     * 查询出库单
     * 
     * @param outboundId 出库单主键
     * @return 出库单
     */
    public OutboundOrder selectOutboundOrderByOutboundId(Long outboundId);

    /**
     * 查询出库单列表
     * 
     * @param outboundOrder 出库单
     * @return 出库单集合
     */
    public List<OutboundOrder> selectOutboundOrderList(OutboundOrder outboundOrder);

    /**
     * 新增出库单
     * 
     * @param outboundOrder 出库单
     * @return 结果
     */
    public int insertOutboundOrder(OutboundOrder outboundOrder);

    /**
     * 修改出库单
     * 
     * @param outboundOrder 出库单
     * @return 结果
     */
    public int updateOutboundOrder(OutboundOrder outboundOrder);

    /**
     * 删除出库单
     * 
     * @param outboundId 出库单主键
     * @return 结果
     */
    public int deleteOutboundOrderByOutboundId(Long outboundId);

    /**
     * 批量删除出库单
     * 
     * @param outboundIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOutboundOrderByOutboundIds(Long[] outboundIds);

    /**
     * 获取最后一个出库单号
     * @param currentDate
     * @return
     */
    String selectLastOutboundNumberForUpdate(@Param("currentDate") String currentDate);

    /**
     * 检查出库单号是否存在
     * @param code
     * @return
     */
    int checkOutboundNumberExists(@Param("code") String code);


    /**
     * 获取未出库的出库单记录数
     */
    int getUnpairedOutBoundStats();
}
